#ifndef __MESSAGES_H_
#define __MESSAGES_H_

enum MessageTypeLC
{
	LC_ROOM_LIST   = 0,
	LC_CREATE_ROOM = 1,
	LC_DELETE_ROOM = 2,
};

struct MessageLC
{
	MessageTypeLC type;
};

struct MessageLCCreateRoom
{
	MessageTypeLC type;
	char room_name[65];
};

struct MessageLCDeleteRoom
{
	MessageTypeLC type;
	short room_port;
};

enum MessageTypeCL
{
	CL_ROOM_LIST           = 0,
	CL_ROOM_CREATED        = 1,
	CL_ROOM_DELETED        = 2,
	CL_ROOM_HAS_ASSOCIATES = 3,
};

struct MessageCL
{
	MessageTypeCL type;
};

struct MessageCLRoomList
{
	MessageTypeCL type;
	short room_count;
	struct
	{
		char room_name[65];
		short room_port;
	} rooms[128];
};

enum MessageTypeLS
{
	LS_ASSOCIATE   = 0,
	LS_DEASSOCIATE = 1,
	LS_MESSAGE     = 2,
};

struct MessageLS
{
	MessageTypeLS type;
};

struct MessageLSAssociate
{
	MessageTypeLS type;
	char user_name[65];
};

struct MessageLSMessage
{
	MessageTypeLS type;
	char message[65534];
};

enum MessageTypeSL
{
	SL_ASSOCIATE_OK   = 0,
	SL_DEASSOCIATE_OK = 1,
	SL_MESSAGE        = 2,
};

struct MessageSL
{
	MessageTypeSL type;
};

struct MessageSLMessage
{
	MessageTypeSL type;
	char message[65534];
};


enum MessageTypeSC
{
	SC_PONG                = 0,
	SC_ROOM_HAS_ASSOCIATES = 1,
	SC_ROOM_DELETED        = 2,
};

struct MessageSC
{
	MessageTypeSC type;
};

enum MessageTypeCS
{
	CS_PING        = 0,
	CS_DELETE_ROOM = 1,
};

struct MessageCS
{
	MessageTypeCS type;
};

#endif
